<template>
  <div class="main_box">
    <div class="detail_wrap" style="padding:10px;">
      <div class="tit" style="margin-left: 35px; padding-left: 45px;">
        <h2>项 目 组 信 息</h2>
        <el-button type="success" size="small" plain icon="fa fa-mail-forward" @click="returnList" > 返 回</el-button>
      </div>
      <div class="con">
        <ul>
          <li>
            <label class="label">文档类型:</label>
            <span>{{dataInfo.documentType | typefilter}}</span>
          </li>
          <li>
            <label class="label">文档名称:</label>
            <span>{{dataInfo.documentName}}</span>
          </li>
          <li>
            <label class="label">文档描述:</label>
            <span>{{dataInfo.documentDesc}}</span>
          </li>
          <li>
            <label class="label">文档类型:</label>
            <span>{{dataInfo.fileType}}</span>
          </li>
          <li>
            <label class="label">文档地址:</label>
            <span>
              <el-link type="primary" target="_blank" :href="this.dataInfo.fileUrl">{{dataInfo.fileUrl}}</el-link>
            </span>
          </li>
          <li>
            <label class="label">机构名称:</label>
            <span>{{dataInfo.institutionName}}</span>
          </li>
          <li>
            <label class="label">医院名称:</label>
            <span>{{dataInfo.hospitalName}}</span>
          </li>
          <li>
            <label class="label">一级分类:</label>
            <span>{{dataInfo.firstClassifyName}}</span>
          </li>
          <li>
            <label class="label">二级分类:</label>
            <span>{{dataInfo.classifyName}}</span>
          </li>
          <li>
            <label class="label">文档状态:</label>
            <span>{{dataInfo.documentState | documentStatefilter}}</span>
          </li>
          <li>
            <label class="label">状态:</label>
            <span>{{dataInfo.state|statefilter}}</span>
          </li>
          <li>
            <label class="label">备注:</label>
            <span>{{dataInfo.remark}}</span>
          </li>
          <li>
            <label class="label">创建人:</label>
            <span>{{dataInfo.createUserName}}</span>
          </li>
          <li>
            <label class="label">创建时间:</label>
            <span>{{dataInfo.createDate}}</span>
          </li>

        </ul>
      </div>

    </div>
  </div>
</template>

<script>
import DocumentApi from "@/api/document/document";
export default {
  data() {
    return {
      dataInfo: []
    }
  },
  methods: {
    getData() {
      let _this = this
      DocumentApi.getDocument({documentId: _this.$route.query.id})
        .then(res => {
          this.dataInfo = res.data;
          console.log(res.data)
        });
    },
    returnList() {
      this.$store.dispatch('delView', this.$route);
      this.$router.push('/document/documentInfoManagement')
    }
  },
  mounted() {
    this.getData();
  },
  filters:{
    typefilter(value) {
      if(value == 1){
      return "医院文档"
      }else if(value == 2){
        return "医检文档"
      }else if(value == 3){
        return "系统文档"
      }else{
        return "错误类型 请联系管理员"
      }
    },
    documentStatefilter(value){
        if(value == 0){
            return "待处理"
        }else if(value == 1){
            return "已处理"
        }else if(value == 2){
            return "已回复"
        }
    },
    statefilter(value){
        if(value == 1){
            return "启用中"
        }else if(value == 0){
            return "已禁用"
        }else if(value == -1){
            return "已删除"
        }
    },
  }

};
</script>
<style lang="scss" src="@/assets/css/views/Detail.scss" scope>
</style>
